import axios from './axios.js'

export const getMenuTree = () => {
	return axios.request({
		url: 'api/system/menu/list',
		method: 'get'
	})
}

export const getMenuList = (params) => {
	return axios.request({
		url: 'api/system/menu/list',
		method: 'get',
		params
	})
}

export function addMenu(data) {
  return axios.request({
    url: 'api/system/menu',
    method: 'post',
    data: data
  })
}

export function updateMenu(data) {
  return axios.request({
    url: 'api/system/menu',
    method: 'put',
    data: data
  })
}

export function delMenu(id) {
  return axios.request({
    url: 'api/system/menu/'+id,
    method: 'delete'
  })
}